package com.jellify

import  android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
import com.margelo.nitro.nitroota.core.getStoredBundlePath
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative



class MainApplication : Application(), ReactApplication {


  override val reactHost: ReactHost by lazy {
    getDefaultReactHost(
      context = applicationContext,
      packageList =
        PackageList(this).packages.apply {
          // Packages that cannot be autolinked yet can be added manually here, for example:
          // add(MyReactNativePackage())
        },
        jsBundleFilePath = getStoredBundlePath(applicationContext)
    )
  }
  


  override fun onCreate() {
    super.onCreate()
    loadReactNative(this)
  }
}